***** OPEN OUTPUT LOG FILE FOR APPENDIX ANALYSES B *****

log using "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Output\Hardwiring Committment.APPENDIX B.04-21-2023.smcl", replace



**** APPENDIX B STATISTICAL ANALYSES: ALTERNATIVE MECHANISM MODELS ***







*** NOTE 1: IN THE APPENDIX, WE ARE ONLY GOING TO REPORT THE CORRESPONDING FIGURE 2 TYPE ESTIMATES BASED ON THE IQR MARGINAL EFFECT CHANGE IN THE HAZARD RATIO HORIZONTAL PLOTS WITH 95% CIs ***


*** NOTE 2: TO SIMPLIFY BOTH THE ANALYSES AND PRESENTATION, WE WILL ONLY PRESENT THE RESULTS FROM THE TWO-WAY FIXED EFFECTS MODEL SPECIFICATIONS [MODELS 2 & 4] ***



*** NOTE 3: CONSISTENT WITH THE THEORY -- ONLY GRAPHING THE INTERACTION EFFECT BETWEEN ZLOYALMEDIAN AND COVARIATE OF INTEREST FOR CONSISTENCY PURPOSES ***






** RETRIEVE SINGLE EVENT RECORDS DATABASE [N = 860 APPOINTEE OBSERVATIONS: 831 UNCENSORED OBSERVATIONS; 29 CENSORED OBSERVATIONS] **


use "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Data\Krause and Byers.SRD.06-03-2022.dta", replace


*
*


** GENERATE CENSORING VARIABLE FOR HOLDOVER APPOINTEES SERVING BETWEEN/ACROSS ADMINISTRATIONS [=1]; UNCENSRED OBSERVATIONS [=0] ** 

gen singleadmin_service=1 if holdover==0
*
replace singleadmin_service=0 if holdover==1
*
*
tab singleadmin_service


** SET FOR SURVIVAL DATA WITH A SINGLE RECORD PER APPOINTEE OBSERVATION [N = 860: UNCENSORED N = 831; CENSORED N = 29] ** 
stset okapptdur, failure(singleadmin_service)

*
*
*
*

** ESTIMATE COX SEMIPARAMETRIC AND WEIBULL PARAMETRIC MODELS PRESENTED IN MANUSCRIPT [TABLE 1: MODELS 1 - 4] ** 

** NOTE COVARIATES THAT VARY TRHOUGH TIME ARE BASED ON THE STARTING DATE OF APPOINTED SERVICE [I.E., "OKSTART....""]




*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





*** APPENDIX ANALYSES B: ALTERNATIVE MECHANISMS ****


*** FIRST, BEGIN WITH MANUSCRIPT REPORTED MODELS 2 & 4 -- AND FIGURE 2 FOR THE GRAPHICAL PRESENTATION TO BE INCLUDED IN THE APPENDIX DOCUMENT




**** MODEL 2: COX MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43,  hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure B1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.3653231, eform(hr)
matrix model2zloyal = r(table)
mat list model2zloyal








**** MODEL 4: WEIBULL MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43, distribution(weibull) hr vce(cluster sbagency)
*
estat ic



*** COMPUTE Figure B1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.3653231, eform(hr)
matrix model4zloyal = r(table)
mat list model4zloyal



**** COMPUTE Figure B2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3653231 [0.9692858 - (-0.3960373)]

** Generate 'manual' interaction variable ** 
generate loyalppdiff = soubinaryagency2nom*zloyalmedian

** Re-Estimate Model 4  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom loyalppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr i.sbagency reagan bush41 clinton bush43, distribution(weibull) hr vce(cluster sbagency)

estimates store model4b

margins, predict(median time) at(loyalppdiff=(-0.3960373 0.9692858))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(loyalppdiff=(-0.3960373 0.9692858))  contrast(atcontrast(r))

matrix model4azloyal = r(table)
mat list model4azloyal



estimates restore model4b

margins, predict(median time) at(loyalppdiff=(-0.6451644 1.711348))
margins, predict(median time) at(loyalppdiff=(-0.6451644 1.711348))  contrast(atcontrast(r))

matrix model4bzloyal = r(table)
mat list model4bzloyal


*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************




**** ALTERNATIVE MECHANISM B1: DOES POLICY PRIORITY DISTINCTION HAVE A DIFFERENTIAL EFFECT OF APPOINTEE MANAGERIAL COMPETENCE ON APPOINTEE TENURE? ***




**** MODEL B1.1:  APPOINTEE MANAGERIAL COMPETENCE X POLICY PRIORITY AGENCY -- COX MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   zloyalmedian zpecompmedian  c.zmecompmedian##i.soubinaryagency2nom  toplevel2 presagencyideolalign  presagencyideolopposed  subagencydesign  standaloneagencydesign okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43 ,  hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure B1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{2 [M2 & M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest 1.soubinaryagency2nom#c.zmecompmedian*1.3653231, eform(hr)
matrix modelB11zmecom = r(table)
mat list modelB11zmecom





**** MODEL B1.2: APPOINTEE MANAGERIAL COMPETENCE X POLICY PRIORITY AGENCY -- WEIBULL MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****


streg   zloyalmedian zpecompmedian  c.zmecompmedian##i.soubinaryagency2nom  toplevel2 presagencyideolalign  presagencyideolopposed  subagencydesign standaloneagencydesign okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment   i. okstartadyr  i.sbagency reagan bush41 clinton bush43 ,  distribution(weibull) hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure B1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{2 [M2 & M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest 1.soubinaryagency2nom#c.zmecompmedian*1.3653231, eform(hr)
matrix modelB12zmecom = r(table)
mat list modelB12zmecom



**** COMPUTE Figure B2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3653231 [0.9692858 - (-0.3960373)]

** Generate 'manual' interaction variable ** 
generate zmecomppdiff = soubinaryagency2nom*zmecompmedian

** Re-Estimate Model 3  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom zmecomppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr i.sbagency reagan bush41 clinton bush43, distribution(weibull) hr vce(cluster sbagency)

estimate store modelb12a


margins, predict(median time) at(zmecomppdiff=(-0.3960373 0.9692858))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(zmecomppdiff=(-0.3960373 0.9692858))  contrast(atcontrast(r))
matrix modelB12azmecom = r(table)
mat list modelB12azmecom



estimates restore modelb12a

margins, predict(median time) at(zmecomppdiff=(-0.6451644 1.711348))
margins, predict(median time) at(zmecomppdiff=(-0.6451644 1.711348))  contrast(atcontrast(r))

matrix modelB12bzmecom = r(table)
mat list modelB12bzmecom


*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************




**** ALTERNATIVE MECHANISM B2: DOES POLICY PRIORITY DISTINCTION HAVE A DIFFERENTIAL EFFECT OF APPOINTEE POLICY COMPETENCE ON APPOINTEE TENURE? ***




**** MODEL B2.1:  APPOINTEE POLICY COMPETENCE X POLICY PRIORITY AGENCY -- COX MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   zloyalmedian c.zpecompmedian##i.soubinaryagency2nom  zmecompmedian  toplevel2 presagencyideolalign  presagencyideolopposed  subagencydesign  standaloneagencydesign okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43 ,  hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure B1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{2 [M2 & M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest 1.soubinaryagency2nom#c.zpecompmedian*1.3653231, eform(hr)
matrix modelB21zpecom = r(table)
mat list modelB21zpecom




**** COMPUTE Figure B2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3653231 [0.9692858 - (-0.3960373)]





**** MODEL B2.2: APPOINTEE POLICY COMPETENCE X POLICY PRIORITY AGENCY -- WEIBULL MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   zloyalmedian c.zpecompmedian##i.soubinaryagency2nom  zmecompmedian   toplevel2 presagencyideolalign  presagencyideolopposed  subagencydesign standaloneagencydesign okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43 ,  distribution(weibull) hr vce(cluster sbagency)
*
estat ic 


*** COMPUTE Figure B1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{2 [M2 & M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest 1.soubinaryagency2nom#c.zpecompmedian*1.3653231, eform(hr)
matrix modelB22zpecom = r(table)
mat list modelB22zpecom





**** COMPUTE Figure B2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3653231 [0.9692858 - (-0.3960373)]

** Generate 'manual' interaction variable ** 
generate zpecomppdiff = soubinaryagency2nom*zpecompmedian

** Re-Estimate Model 3  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom zpecomppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr i.sbagency reagan bush41 clinton bush43, distribution(weibull) hr vce(cluster sbagency)

estimate store modelb22a


margins, predict(median time) at(zpecomppdiff=(-0.3960373 0.9692858))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(zpecomppdiff=(-0.3960373 0.9692858))  contrast(atcontrast(r))
matrix modelB22azpecom = r(table)
mat list modelB22azpecom



estimates restore modelb22a

margins, predict(median time) at(zpecomppdiff=(-0.6451644 1.711348))
margins, predict(median time) at(zpecomppdiff=(-0.6451644 1.711348))  contrast(atcontrast(r))

matrix modelB22bzpecom = r(table)
mat list modelB22bzpecom


**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




**** ALTERNATIVE MECHANISM B3: DOES APPOINTEE LOYALTY TRANSLATE INTO SHORTER [LONGER] SERVICE FOR TOP LEVEL [SUBORDIDATE LEVEL] POLITICAL EXECUTIVES?  ***




**** MODEL B3.1: APPOINTEE LOYALTY X TOPLEVEL2 -- COX MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   c.zloyalmedian##i.toplevel2  zpecompmedian  zmecompmedian  soubinaryagency2nom  presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43,  hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure B1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {TOP LEVEL − SUBORDINATE Difference} {{2 [M2 & M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest 1.toplevel2#c.zloyalmedian*1.3653231, eform(hr)
matrix modelB31zloyal = r(table)
mat list modelB31zloyal




**** MODEL B3.2: APPOINTEE LOYALTY X TOPLEVEL2 -- WEIBULL MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   c.zloyalmedian##i.toplevel2  zpecompmedian  zmecompmedian  soubinaryagency2nom   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43,  distribution(weibull) hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure B1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {TOP LEVEL − SUBORDINATE Difference} {{2 [M2 & M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest 1.toplevel2#c.zloyalmedian*1.3653231, eform(hr)
matrix modelB32zloyal = r(table)
mat list modelB32zloyal




**** COMPUTE Figure B2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3653231 [0.9692858 - (-0.3960373)]

** Generate 'manual' interaction variable ** 
generate zloytopppdiff = toplevel2*zloyalmedian

** Re-Estimate Model 3  with 'manual' interaction variable **
streg   zloyalmedian toplevel2 zloytopppdiff  zpecompmedian  zmecompmedian  soubinaryagency2nom   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43,  distribution(weibull) hr vce(cluster sbagency)

estimate store modelb32a


margins, predict(median time) at(zloytopppdiff=(-0.3960373 0.9692858))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(zloytopppdiff=(-0.3960373 0.9692858))  contrast(atcontrast(r))
matrix modelB32azloytopppdiff = r(table)
mat list modelB32azloytopppdiff



estimates restore modelb32a

margins, predict(median time) at(zloytopppdiff=(-0.6451644 1.711348))
margins, predict(median time) at(zloytopppdiff=(-0.6451644 1.711348))  contrast(atcontrast(r))

matrix modelB32bzloytopppdiff = r(table)
mat list modelB32bzloytopppdiff


*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************





**** ALTERNATIVE MECHANISM B4: DOES APPOINTEE LOYALTY TRANSLATE INTO LONGER [SHORTER] SERVICE UNDER LOWER [HIGHER] PRESIDENT-CONGRESSIONAL IDEOLOGICAL POLICY CONFLICT? ***




**** MODEL B4.1: APPOINTEE LOYALTY X OKSTARTFILIPRESDISTANCE -- COX MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox    c.zloyalmedian##c.okstartfilipresdistance  zpecompmedian  zmecompmedian  soubinaryagency2nom toplevel2 presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean    okcrossover okstartpresapp okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43 ,  hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure B1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {ZLOYALMEDIAN * OKSTARTFILIPRESDISTANCE} {{2 [M2 & M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest c.okstartfilipresdistance#c.zloyalmedian*1.3653231, eform(hr)
matrix modelB41zloyal = r(table)
mat list modelB41zloyal



**** COMPUTE Figure B2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3653231 [0.9692858 - (-0.3960373)]



**** MODEL B4.2: APPOINTEE LOYALTY X OKSTARTFILIPRESDISTANCE -- WEIBULL MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg    c.zloyalmedian##c.okstartfilipresdistance  zpecompmedian  zmecompmedian  soubinaryagency2nom toplevel2 presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean   okcrossover okstartpresapp okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43  i. okstartadyr  i.sbagency reagan bush41 clinton bush43,  distribution(weibull) hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure B1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {ZLOYALMEDIAN * OKSTARTFILIPRESDISTANCE} {{2 [M2 & M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest c.okstartfilipresdistance#c.zloyalmedian*1.3653231, eform(hr)
matrix modelB42zloyal = r(table)
mat list modelB42zloyal


**** COMPUTE Figure B2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3653231 [0.9692858 - (-0.3960373)]

** Generate 'manual' interaction variable ** 
generate zloyokppdiff = zloyalmedian*okstartfilipresdistance

** Re-Estimate Model 3  with 'manual' interaction variable **
streg    zloyalmedian okstartfilipresdistance zloyokppdiff  zpecompmedian  zmecompmedian  soubinaryagency2nom toplevel2 presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean   okcrossover okstartpresapp okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43  i. okstartadyr  i.sbagency reagan bush41 clinton bush43,  distribution(weibull) hr vce(cluster sbagency)

estimate store modelb42a


margins, predict(median time) at(zloyokppdiff=(-0.3960373 0.9692858))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(zloyokppdiff=(-0.3960373 0.9692858))  contrast(atcontrast(r))
matrix modelB42azloyokppdiff = r(table)
mat list modelB42azloyokppdiff



estimates restore modelb42a

margins, predict(median time) at(zloyokppdiff=(-0.6451644 1.711348))
margins, predict(median time) at(zloyokppdiff=(-0.6451644 1.711348))  contrast(atcontrast(r))

matrix modelB42bzloyokppdiff = r(table)
mat list modelB42bzloyokppdiff



*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************



**** ALTERNATIVE MECHANISM B5: DOES APPOINTEE LOYALTY TRANSLATE INTO SHORTER SERVICE IN INDEPENDENT EXECUTIVE AGENCIES COMPARED TO WITHIN EXECUTIVE DEPARTMENTS? WHY? LESS PRESTIGIOUS POSITIONS FOR OCCUPATIONAL OR PROXIMITY TO THE PRESIDENT INFLUENCE ***



**** MODEL B5.1:  APPOINTEE LOYALTY X STANDALONE AGENCY DESIGN -- COX MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   c.zloyalmedian##c.standaloneagencydesign  zpecompmedian  zmecompmedian  soubinaryagency2nom toplevel2 presagencyideolalign  presagencyideolopposed  subagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43 ,  hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure B1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {STANDALONE − NON-STANDALONE Difference} {{2 [M2 & M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest c.standaloneagencydesign#c.zloyalmedian*1.3653231, eform(hr)
matrix modelB51zloyal = r(table)
mat list modelB51zloyal



**** COMPUTE Figure B2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3653231 [0.9692858 - (-0.3960373)]



**** MODEL B5.2: APPOINTEE LOYALTY X STANDALONE AGENCY DESIGN -- WEIBULL MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   c.zloyalmedian##c.standaloneagencydesign  zpecompmedian  zmecompmedian  soubinaryagency2nom toplevel2 presagencyideolalign  presagencyideolopposed  subagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43 ,  distribution(weibull) hr vce(cluster sbagency)
*
estat ic


*** COMPUTE Figure B1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {STANDALONE − NON-STANDALONE Difference} {{2 [M2 & M4] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQ = 1.3653231 [0.9692858 - (-0.3960373)]

lincomest c.standaloneagencydesign#c.zloyalmedian*1.3653231, eform(hr)
matrix modelB52zloyal = r(table)
mat list modelB52zloyal



**** COMPUTE Figure B2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [M1−M4] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3653231 [0.9692858 - (-0.3960373)]

** Generate 'manual' interaction variable ** 
generate zloystdppdiff = zloyalmedian*standaloneagencydesign

** Re-Estimate Model 3  with 'manual' interaction variable **
streg   zloyalmedian standaloneagencydesign zloystdppdiff  zpecompmedian  zmecompmedian  soubinaryagency2nom toplevel2 presagencyideolalign  presagencyideolopposed  subagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i. okstartadyr  i.sbagency reagan bush41 clinton bush43 ,  distribution(weibull) hr vce(cluster sbagency)

estimate store modelb52a


margins, predict(median time) at(zloystdppdiff=(-0.3960373 0.9692858))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(zloystdppdiff=(-0.3960373 0.9692858))  contrast(atcontrast(r))
matrix modelB52azloystdppdiff = r(table)
mat list modelB52azloystdppdiff



estimates restore modelb52a

margins, predict(median time) at(zloystdppdiff=(-0.6451644 1.711348))
margins, predict(median time) at(zloystdppdiff=(-0.6451644 1.711348))  contrast(atcontrast(r))

matrix modelB52bzloystdppdiff = r(table)
mat list modelB52bzloystdppdiff


********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



*Figure B1

matrix pointmodel = model2zloyal[1,1], model4zloyal[1,1], model2zloyal[7,1], modelB11zmecom[1,1], modelB12zmecom[1,1], modelB21zpecom[1,1], modelB22zpecom[1,1], modelB31zloyal[1,1], modelB32zloyal[1,1], modelB41zloyal[1,1], modelB42zloyal[1,1], modelB51zloyal[1,1], modelB52zloyal[1,1]      


*
matrix cimodel = (model2zloyal[5,1], model4zloyal[5,1], model2zloyal[7,1], modelB11zmecom[5,1], modelB12zmecom[5,1], modelB21zpecom[5,1], modelB22zpecom[5,1], modelB31zloyal[5,1], modelB32zloyal[5,1], modelB41zloyal[5,1], modelB42zloyal[5,1], modelB51zloyal[5,1], modelB52zloyal[5,1] \ model2zloyal[6,1], model4zloyal[6,1], model2zloyal[7,1], modelB11zmecom[6,1], modelB12zmecom[6,1], modelB21zpecom[6,1], modelB22zpecom[6,1], modelB31zloyal[6,1], modelB32zloyal[6,1], modelB41zloyal[6,1], modelB42zloyal[6,1], modelB51zloyal[6,1], modelB52zloyal[6,1])



coefplot (matrix(pointmodel), ci((cimodel))), grid(none) xline(1, lcolor(red%40) lpattern(dash)) xtitle("Hazard Ratio", size(vsmall) margin(t=2)) ylabel(1 `""Presidential Loyalty x Policy Priority Agencies" "[Model 2]""' 2 `""Presidential Loyalty x Policy Priority Agencies" "[Model 4]""' 3  " " 4 `""Managerial Competence x Policy Priority Agencies" "[Model B1.2]""' 5 `""Managerial Competence x Policy Priority Agencies" "[Model B1.4]""' 6 `""Policy Competence x Policy Priority Agencies" "[Model B2.2]""' 7 `""Policy Competence x Policy Priority Agencies" "[Model B2.4]""' 8 `""Presidential Loyalty x Agency Position Type" "[Model B3.2]""' 9 `""Presidential Loyalty x Agency Position Type" "[Model B3.4]""' 10 `""Presidential Loyalty x  President − Senate Filibuster Distance at Start" "[Model B3.2]""' 11 `""Presidential Loyalty x President − Senate Filibuster Distance at Start" "[Model B3.4]""' 12 `""Presidential Loyalty x Independent Executive Agency" "[Model B4.2]""' 13 `""Presidential Loyalty x Independent Executive Agency" "[Model B4.2]""', labsize(vsmall) noticks) mlabel format(%9.3f) mlabposition(12) mlabsize(vsmall) xlabel(0(1)2, angle(0) labsize(vsmall) format(%9.1f)) msymbol(o) mcolor(black) msize(small) title("FIGURE B1", size(small)) ciopts(lcolor(black)) legend(off) subtitle("Marginal Differential Effect of Alternative Mechanisms Predicting Hazard Ratio of Appointee Tenure", size(vsmall)) xsize(5.5) ysize(3)

graph save "Graph" "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Graphics\FigureB1.gph", replace


*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************


*Figure B2



matrix pointmodel1 = model4azloyal[1,1], model4bzloyal[1,1], model4bzloyal[7,1], modelB12azmecom[1,1], modelB12bzmecom[1,1], modelB22azpecom[1,1], modelB22bzpecom[1,1], modelB32azloytopppdiff[1,1], modelB32bzloytopppdiff[1,1], modelB42azloyokppdiff[1,1], modelB42bzloyokppdiff[1,1], modelB52azloystdppdiff[1,1], modelB52bzloystdppdiff[1,1]

*
matrix cimodel1 = (model4azloyal[5,1], model4bzloyal[5,1], model4bzloyal[7,1], modelB12azmecom[5,1], modelB12bzmecom[5,1], modelB22azpecom[5,1], modelB22bzpecom[5,1], modelB32azloytopppdiff[5,1], modelB32bzloytopppdiff[5,1], modelB42azloyokppdiff[5,1], modelB42bzloyokppdiff[5,1], modelB52azloystdppdiff[5,1], modelB52bzloystdppdiff[5,1] \ model4azloyal[6,1], model4bzloyal[6,1], model4bzloyal[7,1], modelB12azmecom[6,1], modelB12bzmecom[6,1], modelB22azpecom[6,1], modelB22bzpecom[6,1], modelB32azloytopppdiff[6,1], modelB32bzloytopppdiff[6,1], modelB42azloyokppdiff[6,1], modelB42bzloyokppdiff[6,1], modelB52azloystdppdiff[6,1], modelB52bzloystdppdiff[6,1])


coefplot (matrix(pointmodel1), ci((cimodel1))), grid(none) xline(0, lcolor(red%40) lpattern(dash)) xtitle("Predicted Number of Days", size(vsmall) margin(t=2)) ylabel(1 `""Presidential Loyalty x Policy Priority Agencies" " Interquartile Change [Model 4]""' 2 `""Presidential Loyalty x Policy Priority Agencies" "Interdecile Change [Model 4]""' 3 " " 4 `""Managerial Competence x Policy Priority Agencies" "Interquartile Change [Model B1.2]""' 5 `""Managerial Competence x Policy Priority Agencies" "Interdecile Change [Model B1.4]""' 6 `""Policy Competence x Policy Priority Agencies:" "Interquartile Change [Model B2.2]""' 7 `""Policy Competence x Policy Priority Agencies" "Interdecile Change [Model B2.4]""' 8 `""Presidential Loyalty x Agency Position Type" "Interquartile Change [Model B3.2]""' 9 `""Presidential Loyalty x Agency Position Type" "Interdecile Change [Model B3.4]""' 10 `""Presidential Loyalty x President - Senate Filibuster Distance at Start" "Interquartile Change [Model B3.2]""' 11 `""Presidential Loyalty x President - Senate Filibuster Distance at Start" "Interdecile Change [Model B3.4]""' 12 `""Presidential Loyalty x Independent Executive Agency" "Interquartile Change [Model B4.2]""' 13 `""Presidential Loyalty x Independent Executive Agency" "Interdecile Change [Model B4.4]""', labsize(vsmall) noticks) mlabel format(%9.0f) mlabposition(12) mlabsize(vsmall) xlabel(-500(100)1000, angle(0) labsize(vsmall) format(%9.0f))   msymbol(o) mcolor(black) msize(small) title("FIGURE B2", size(small)) ciopts(lcolor(black)) legend(off) subtitle("Marginal Differential Effect of Alternative Mechanisms Predicting Median Appointee Tenure [Model 4]", size(vsmall)) xsize(5.5) ysize(3)

graph save "Graph" "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Graphics\FigureB2.gph", replace

*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



log close








